package inits

import (
	"context"
	"github.com/go-redis/redis/v8"
	"log"
	"video-software/global"
)

func InitRedis() {
	global.RDB = redis.NewClient(&redis.Options{
		Addr:     "124.220.135.42:6379",
		Password: "c258f478e9ad1784478c25a556e45e6a", // no password set
		DB:       4,                                  // use default DB
	})

	err := global.RDB.Ping(context.Background()).Err()
	if err != nil {
		panic(err)
	}

	log.Println("redis init mysql")

}
